<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      >
    <h:head>
        <title>Quản lí sản phẩm</title>
        <script>
            function confirmComplete() {
                var answer = confirm("Bạn có chắc chắn muốn xóa bản ghi này?");
                if (answer == true)
                {
                    return true;
                }
                else
                {
                    return false;
                }
            }
        </script>  
    </h:head>
    <h:body>
        <link type="text/css" rel="stylesheet" href="../css/main.css" />
        <style type="text/css">                
            .ui-corner-all{
                border-radius: 0px !important
            }
            .ui-tree.ui-widget.ui-widget-content.ui-corner-all{
                border: solid 0px !important;
            }
        </style>
        <style type="text/css">
            .ui-panelgrid td {
                border-color:inherit;
                border-style:solid;
                border-width:0px;
                padding:6px 7.5px;
            }
        </style>
        <style type="text/css">
            td {
                vertical-align: top !important;
            }
            .pnct td{
                vertical-align: middle !important;
            }
        </style>
        <style type="text/css">
            .ui-panel {
                padding:0;
            }
        </style>
        <style type="text/css">
            .ui-widget{font-size:95% !important;}
            .ui-layout-unit-content{background-color: #E5E5E5;border-width: 0px}          
            .ui-widget{border-width: 0px;color: red}
        </style>
        <div align="center" id="bodyForm" >            
            <div style="width: 100%;">
                <p:layoutUnit id="top" position="north" size="auto">
                    <ui:insert name="menu">
                        <ui:include src="../../templates/menu.xhtml"/>
                    </ui:insert>
                </p:layoutUnit>
                <p:layoutUnit id="center" position="center" size="400">
                    <h1 class="headerbar">Quản lý sản phẩm</h1>
                    <h:form id="form" style="width: 98%;">
                        <p:growl id="message"/>
                        <h:panelGrid columns="2" style="width: 100%">
                            <p:panel header="#{PP_TREEPRODUCT.services}" id="pnltree">
                                <p:tree  id="treeuser" 
                                         value="#{treeProduct.root}" var="tree"
                                         selectionMode="single" highlight="true" 
                                         selection="#{treeProduct.selectedNodes}">                                         
                                    <p:ajax event="select" update=":form:pnlInput" listener="#{treeProduct.onNodeSelect}" /> 
                                    <p:treeNode  expandedIcon="ui-icon-folder-open"  
                                                 collapsedIcon="ui-icon-folder-collapsed">
                                        #{tree.NAME}
                                    </p:treeNode>
                                </p:tree>
                                <p:blockUI id="treeblock" block="pnltree" widgetVar="treeblock"/> 
                            </p:panel>
                            <p:panel id="pnlInput" header="#{PP_TREEPRODUCT.product}" style="width: 100%;">
                                <p:panelGrid columns="6">
                                    <h:outputText value="#{PP_TREEPRODUCT.sdp_product_code}" style="color:red;"></h:outputText>
                                    <p:inputText disabled="#{treeProduct.isbFieldEnable()}" maxlength="200"
                                                 value="#{treeProduct.ETT_Product.SDP_PRODUCT_CODE}"></p:inputText>

                                    <h:outputLabel value="#{PP_TREEPRODUCT.product_name}" style="color:red;"/>
                                    <p:inputText disabled="#{treeProduct.isbFieldEnable()}" maxlength="200"
                                                 value="#{treeProduct.ETT_Product.PRODUCT_NAME}"></p:inputText>

                                    <h:outputText value="#{PP_TREEPRODUCT.welcome_message}"></h:outputText>
                                    <p:inputText disabled="#{treeProduct.isbFieldEnable()}" maxlength="500"
                                                 value="#{treeProduct.ETT_Product.WELCOME_MESSAGE}"></p:inputText>

                                    <h:outputLabel value="#{PP_TREEPRODUCT.farewell_message}"/>
                                    <p:inputText disabled="#{treeProduct.isbFieldEnable()}"  maxlength="500"
                                                 value="#{treeProduct.ETT_Product.FAREWELL_MESSAGE}"></p:inputText>

                                    <h:outputText value="#{PP_TREEPRODUCT.service_number}" style="color:red;"></h:outputText>
                                    <p:inputMask disabled="#{treeProduct.isbFieldEnable()}" mask="9999"
                                                 value="#{treeProduct.ETT_Product.SERVICE_NUMBER}">
                                    </p:inputMask>

                                    <h:outputLabel value="#{PP_TREEPRODUCT.register_keyword}" style="color:red;"/>
                                    <p:inputText disabled="#{treeProduct.isbFieldEnable()}"  maxlength="100"
                                                 value="#{treeProduct.ETT_Product.REGISTER_KEYWORD}"></p:inputText>

                                    <h:outputText value="#{PP_TREEPRODUCT.cancel_keyword}" style="color:red;"></h:outputText>
                                    <p:inputText disabled="#{treeProduct.isbFieldEnable()}"  maxlength="100"
                                                 value="#{treeProduct.ETT_Product.CANCEL_KEYWORD}"></p:inputText>

                                    <h:outputLabel value="#{PP_TREEPRODUCT.created_time}" style="color:red;"/>
                                    <p:calendar value="#{treeProduct.ETT_Product.CREATED_TIME}" pattern="dd/MM/yyyy HH:mm:ss"  
                                                disabled="#{treeProduct.isbFieldEnable()}"
                                                />
                                    <h:outputText value="#{PP_TREEPRODUCT.effective_time}"></h:outputText>
                                    <p:calendar value="#{treeProduct.ETT_Product.EFFECTIVE_TIME}" pattern="dd/MM/yyyy HH:mm:ss"  
                                                disabled="#{treeProduct.isbFieldEnable()}"
                                                />
                                    <h:outputText value="#{PP_TREEPRODUCT.expiry_time}"></h:outputText>
                                    <p:calendar value="#{treeProduct.ETT_Product.EXPIRY_TIME}" pattern="dd/MM/yyyy HH:mm:ss"  
                                                disabled="#{treeProduct.isbFieldEnable()}"
                                                />
                                    <h:outputLabel value="#{PP_TREEPRODUCT.content_builder_class_id}"/>
                                    <p:selectOneMenu disabled="#{treeProduct.isbFieldEnable()}" 
                                                     value="#{treeProduct.ETT_Product.CONTENT_BUILDER_CLASS_ID}">
                                        <f:selectItems value="#{treeProduct.listContentBuilderClass}" var="item_name"
                                                       itemLabel="#{item_name.NAME}" itemValue="#{item_name.ID}" />   
                                    </p:selectOneMenu>

                                    <h:outputText value="#{PP_TREEPRODUCT.content_builder_type}"></h:outputText>
                                    <p:selectOneMenu disabled="#{treeProduct.isbFieldEnable()}" 
                                                     value="#{treeProduct.ETT_Product.CONTENT_BUILDER_TYPE}" >
                                        <f:selectItem itemValue="1" itemLabel="#{PP_TREEPRODUCT.auto}"/>
                                        <f:selectItem itemValue="2" itemLabel="#{PP_TREEPRODUCT.manual}"/>
                                    </p:selectOneMenu>

                                    <h:outputText value="#{PP_TREEPRODUCT.content_mode}"></h:outputText>
                                    <p:selectOneMenu disabled="#{treeProduct.isbFieldEnable()}" 
                                                     value="#{treeProduct.ETT_Product.CONTENT_MODE}">
                                        <f:selectItems value="#{treeProduct.listContentMode}" var="item_name"
                                                       itemLabel="#{item_name.NAME}" itemValue="#{item_name.ID}" />   
                                    </p:selectOneMenu>

                                    <h:outputText value="#{PP_TREEPRODUCT.char_mode}"></h:outputText>
                                    <p:selectOneMenu disabled="#{treeProduct.isbFieldEnable()}" 
                                                     value="#{treeProduct.ETT_Product.CHARGING_MODE}" > 
                                        <f:selectItems value="#{treeProduct.listChargingMode}" var="item_name"
                                                       itemLabel="#{item_name.NAME eq 1 ? PP_TREEPRODUCT.auto:PP_TREEPRODUCT.manual}" itemValue="#{item_name.ID}" />   
                                    </p:selectOneMenu>

                                    <h:outputLabel value="#{PP_TREEPRODUCT.charging_class_id}"/>
                                    <p:selectOneMenu disabled="#{treeProduct.isbFieldEnable()}" 
                                                     value="#{treeProduct.ETT_Product.CHARGING_CLASS_ID}">
                                        <f:selectItems value="#{treeProduct.listChargingClass}" var="item_name"
                                                       itemLabel="#{item_name.NAME}" itemValue="#{item_name.ID}" />   
                                    </p:selectOneMenu>

                                    <h:outputText value="#{PP_TREEPRODUCT.status}"></h:outputText>
                                    <p:selectOneMenu disabled="#{treeProduct.isbFieldEnable()}" 
                                                     value="#{treeProduct.ETT_Product.STATUS}" >
                                        <f:selectItem itemValue="0" itemLabel="#{PP_TREEPRODUCT.disable}"/>
                                        <f:selectItem itemValue="1" itemLabel="#{PP_TREEPRODUCT.enable}"/>
                                    </p:selectOneMenu>
                                    <h:outputText value="Loại tin nhắn"/>
                                    <p:selectOneMenu disabled="#{treeProduct.isbFieldEnable()}" value="#{treeProduct.ETT_Product.contentType}">
                                        <f:selectItem itemValue="text" itemLabel="text"/>
                                        <f:selectItem itemValue="wappush" itemLabel="wappush"/>
                                    </p:selectOneMenu>
                                                                        
                                    <h:outputText value="Thời gian dịch vụ"/>
                                    <p:inputText disabled="#{treeProduct.isbFieldEnable()}" value="#{treeProduct.ETT_Product.effective_duration}"/>
                                    <h:outputText value="Build Procedure"/>
                                    <p:inputTextarea disabled="#{treeProduct.isbFieldEnable()}" value="#{treeProduct.ETT_Product.build_procedure}"/>
                                    
                                    <h:outputText value="Build Content"/>
                                    <p:selectOneRadio disabled="#{treeProduct.isbFieldEnable()}" required="true" requiredMessage="Bạn phải chọn Build Content!" value="#{treeProduct.ETT_Product.build_content}">
                                        <f:selectItem itemLabel="Có" itemValue="1"/>
                                        <f:selectItem itemLabel="Không" itemValue="0"/>
                                    </p:selectOneRadio>
                                    <h:outputText value="Build User Content"/>
                                    <p:selectOneRadio disabled="#{treeProduct.isbFieldEnable()}" required="true" requiredMessage="Bạn phải chọn Build User Content!" value="#{treeProduct.ETT_Product.build_user_content}">
                                        <f:selectItem itemLabel="Có" itemValue="1"/>
                                        <f:selectItem itemLabel="Không" itemValue="0"/>
                                    </p:selectOneRadio>
                                    <h:outputText value="Content Concatenation"/>
                                    <p:selectOneRadio disabled="#{treeProduct.isbFieldEnable()}" required="true" requiredMessage="Bạn phải chọn Content Concatenation!" value="#{treeProduct.ETT_Product.content_concatenation}">
                                        <f:selectItem itemLabel="Có" itemValue="1"/>
                                        <f:selectItem itemLabel="Không" itemValue="0"/>
                                    </p:selectOneRadio>
                                    <p:column></p:column>
                                    <p:column></p:column>
                                    <p:column></p:column>
                                    <p:column></p:column>
                                </p:panelGrid>
                                <div align="center" style="margin-top: 10px;margin-bottom: 10px;margin-left: 10px;">
                                    <p:commandButton value="Quản lí content" style="margin:1px 1px 1px 1px;width: 150px;"
                                                     rendered="#{treeProduct.isbRendered()}"
                                                     disabled="#{treeProduct.isbDisableAddSearch()}"
                                                     update=":formDlgQLContent"
                                                     onclick="dlgQLContent.show()"
                                                     actionListener="#{treeProduct.updateDlgQLContent()}"/>
                                    <p:commandButton  value="#{PP_TREEPRODUCT.add}"
                                                      icon="ui-icon-plusthick" style="margin:1px 1px 1px 100px;width: 110px;"
                                                      rendered="#{treeProduct.isbRendered()}"
                                                      disabled="#{treeProduct.isbDisableAddSearch()}"
                                                      actionListener="#{treeProduct.changeState(2, true)}"
                                                      update=":form:pnlInput" oncomplete="treeblock.show()" />
                                    <p:commandButton  value="#{PP_TREEPRODUCT.addcopy}" icon="ui-icon-copy" style="margin:1px;width: 110px;"
                                                      rendered="#{treeProduct.isbRendered()}"
                                                      disabled="#{!treeProduct.isbDisableModifyRemove()}"
                                                      actionListener="#{treeProduct.changeState(8, true)}"
                                                      update=":form:pnlInput" oncomplete="treeblock.show()"/>
                                    <p:commandButton  value="#{PP_TREEPRODUCT.modify}" icon="ui-icon-wrench" style="margin:1px;width: 110px;"
                                                      rendered="#{treeProduct.isbRendered()}"
                                                      disabled="#{!treeProduct.isbDisableModifyRemove()}"
                                                      actionListener="#{treeProduct.changeState(3, true)}"
                                                      update=":form:pnlInput" oncomplete="treeblock.show()"/>
                                    <p:commandButton  value="#{PP_TREEPRODUCT.remove}" icon="ui-icon-trash" style="margin:1px;width: 110px;"
                                                      rendered="#{treeProduct.isbRendered()}"
                                                      disabled="#{!treeProduct.isbDisableModifyRemove()}"
                                                      onclick="confirmation.show()"
                                                      />
                                    <p:commandButton  value="#{PP_TREEPRODUCT.ok}" icon="ui-icon-disk" style="margin:1px 1px 1px 200px; width: 130px;"
                                                      rendered="#{treeProduct.isbSave()}" 
                                                      actionListener="#{treeProduct.changeState(6, false)}"
                                                      update=":form:pnlInput :form:message :form:tblSys"/>
                                    <p:commandButton  value="#{PP_TREEPRODUCT.cancle}" icon="ui-icon-cancel" style="margin:1px;width: 110px;"
                                                      rendered="#{treeProduct.isbCancel()}" 
                                                      actionListener="#{treeProduct.changeState(7, false)}"
                                                      update=":form:pnlInput" oncomplete="treeblock.hide()"/>

                                </div>

                                <p:scrollPanel style="width:906px;height: 300px" id="pnlData" >
                                    <p:dataTable id="tblSys" 
                                                 var="dataSys" 
                                                 value="#{treeProduct.listData}"
                                                 rowKey="#{dataSys.PRODUCT_ID}" 
                                                 selection="#{treeProduct.selectedRow}" 
                                                 selectionMode="single"
                                                 style="width: 80%;"
                                                 paginator="true" rows="5"  
                                                 paginatorPosition ="bottom"
                                                 paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
                                                 rowsPerPageTemplate="5,10,15">
                                        <p:ajax event="rowSelect" disabled="#{!treeProduct.isbRendered()}"
                                                listener="#{treeProduct.onRowSelect()}" 
                                                update=":form:pnlInput" />
                                        <p:ajax event="rowDblselect" disabled="#{!treeProduct.isbRendered()}"
                                                listener="#{treeProduct.changeState(3, true)}" 
                                                update=":form:pnlInput" />
                                        <f:facet name="header" >  
                                            <h:outputText style="text-align: left;" 
                                                          value="#{PP_TREEPRODUCT.list}"></h:outputText>
                                        </f:facet> 
                                        <p:column headerText="#{PP_TREEPRODUCT.sdp_product_code}" >
                                            <h:outputText value="#{dataSys.SDP_PRODUCT_CODE}"/>
                                        </p:column>
                                        <p:column headerText="#{PP_TREEPRODUCT.product_name}" >
                                            <h:outputText value="#{dataSys.PRODUCT_NAME}"/>
                                        </p:column>

                                        <p:column headerText="#{PP_TREEPRODUCT.welcome_message}" >
                                            <h:outputText value="#{dataSys.WELCOME_MESSAGE}"/>
                                        </p:column>

                                        <p:column headerText="#{PP_TREEPRODUCT.farewell_message}" >
                                            <h:outputText value="#{dataSys.FAREWELL_MESSAGE}"/>
                                        </p:column>

                                        <p:column headerText="#{PP_TREEPRODUCT.service_number}">
                                            <h:outputText value="#{dataSys.SERVICE_NUMBER}"/>
                                        </p:column>

                                        <p:column headerText="#{PP_TREEPRODUCT.register_keyword}" >
                                            <h:outputText value="#{dataSys.REGISTER_KEYWORD}"/>
                                        </p:column>

                                        <p:column headerText="#{PP_TREEPRODUCT.cancel_keyword}">
                                            <h:outputText value="#{dataSys.CANCEL_KEYWORD}"/>
                                        </p:column>

                                        <p:column headerText="#{PP_TREEPRODUCT.created_time}" >
                                            <h:outputText value="#{dataSys.strCREATED_TIME}"/>
                                        </p:column>

                                        <p:column headerText="#{PP_TREEPRODUCT.effective_time}">
                                            <h:outputText value="#{dataSys.strEFFECTIVE_TIME}"/>
                                        </p:column>

                                        <p:column headerText="#{PP_TREEPRODUCT.expiry_time}" >
                                            <h:outputText value="#{dataSys.strEXPIRY_TIME}"/>
                                        </p:column>

                                        <p:column headerText="#{PP_TREEPRODUCT.content_builder_class_id}">
                                            <h:outputText value="#{dataSys.CONTENT_BUILDER_CLASS_ID}"/>
                                        </p:column>

                                        <p:column headerText="#{PP_TREEPRODUCT.content_builder_type}">
                                            <h:outputText value="#{dataSys.CONTENT_BUILDER_TYPE eq 1 ? PP_TREEPRODUCT.manual:PP_TREEPRODUCT.auto}"/>
                                        </p:column>

                                        <p:column headerText="#{PP_TREEPRODUCT.content_mode}">
                                            <h:outputText value="#{dataSys.CONTENT_MODE}"/>
                                        </p:column>

                                        <p:column headerText="#{PP_TREEPRODUCT.char_mode}">
                                            <h:outputText value="#{dataSys.CHARGING_MODE eq 1 ? PP_TREEPRODUCT.manual:PP_TREEPRODUCT.auto}"/>
                                        </p:column>

                                        <p:column headerText="#{PP_TREEPRODUCT.charging_class_id}">
                                            <h:outputText value="#{dataSys.CHARGING_CLASS_ID}"/>
                                        </p:column>

                                        <p:column headerText="#{PP_TREEPRODUCT.status}">
                                            <h:outputText value='#{dataSys.STATUS eq 1 ? PP_TREEPRODUCT.enable:PP_TREEPRODUCT.disable}'></h:outputText>
                                        </p:column>
                                        <p:column headerText="Loại tin nhắn">
                                            <h:outputText value="#{dataSys.contentType}"></h:outputText>
                                        </p:column>
                                        <p:column headerText="Thời gian dịch vụ">
                                            <h:outputText value="#{dataSys.effective_duration}"/>
                                        </p:column>
                                        <p:column headerText="Build Procedure">
                                            <h:outputText value="#{dataSys.build_procedure}"/>
                                        </p:column>
                                        <p:column headerText="Build Content">
                                            <h:outputText value="#{dataSys.build_content eq 1? 'Có' : 'Không'}"/>
                                        </p:column>
                                        <p:column headerText="Build User Content">
                                            <h:outputText value="#{dataSys.build_user_content eq 1? 'Có' : 'Không'}"/>
                                        </p:column>
                                        <p:column headerText="Content Concatenation">
                                            <h:outputText value="#{dataSys.content_concatenation eq 1? 'Có' : 'Không'}"/>
                                        </p:column>
                                        
                                    </p:dataTable>

                                    <style type="text/css">
                                        .accessdtl td {
                                            vertical-align: baseline !important;
                                            text-align: center !important;
                                        }
                                    </style>
                                </p:scrollPanel>

                                <p:confirmDialog id="confirmDialog"
                                                 message="#{PP_TREEPRODUCT.confirm}"
                                                 header="#{PP_TREEPRODUCT.cf_header}" severity="alert"
                                                 widgetVar="confirmation">
                                    <p:commandButton id="confirm" value="#{PP_TREEPRODUCT.sure}" 
                                                     oncomplete="confirmation.hide()" actionListener="#{treeProduct.changeState(4, false)}" update=":form"
                                                     />
                                    <p:commandButton id="decline" value="#{PP_TREEPRODUCT.nyet}"
                                                     onclick="confirmation.hide()" type="button" />
                                </p:confirmDialog>
                            </p:panel>
                        </h:panelGrid>                        
                    </h:form>
                    <!--dialog quan li content-->
                    <p:dialog widgetVar="dlgQLContent" header="Quản lí Product's content" modal="true">
                        <h:form id="formDlgQLContent">
                            <p:dialog modal="true" widgetVar="statusDialog2" header="Đang xử lí.."   
                                      draggable="false" closable="false">  
                                <p:graphicImage value="../../images/ajax-loader.gif" />
                            </p:dialog>
                            <p:growl/>
                            <h:outputText value="Danh sánh content của #{treeProduct.ETT_Product.PRODUCT_NAME}"/>
                            <br/>
                            <p:commandButton value="Thêm" icon="ui-icon ui-icon-circle-plus" action="#{treeProduct.updateInsert()}" update=":formDlgQLContent"/>
                            <br/><br/>
                            <p:dataTable paginator="true" paginatorPosition="bottom" rows="20"
                                         value="#{treeProduct.itemsContent}" var="i">
                                <p:column headerText="Sản phẩm">
                                    <h:outputText value="#{i.product_name}" style="float: left"/>
                                </p:column>
                                <p:column headerText="Template">
                                    <h:outputText value="#{i.content_template_name}" style="float: left"/>
                                </p:column>
                                <p:column headerText="Từ ngày">
                                    <h:outputText value="#{i.from_date}" style="float: left"/>
                                </p:column>
                                <p:column headerText="Đến ngày">
                                    <h:outputText value="#{i.to_date}" style="float: left"/>
                                </p:column>
                                <p:column headerText="Sửa">
                                    <p:commandButton styleClass="ui-icon ui-icon-pencil" action="#{treeProduct.updateEdit()}" onclick="dlgEditPContent.show()" style="width: 20px;height: 20px" update=":formEditPContent"/>
                                </p:column>
                                <p:column headerText="Xóa">
                                    <p:commandButton styleClass="ui-icon ui-icon-trash" update=":formDlgDelContent" onclick="dlgDelPContent.show()" style="width: 20px;height: 20px" action="#{treeProduct.updateRemove()}"/>
                                </p:column>
                            </p:dataTable>
                            <h:panelGrid columns="5" rendered="#{treeProduct.renderAdd}">
                                <h:outputText value="Template: "/>
                                <h:outputText value="Từ ngày: "/>
                                <h:outputText value="Đến ngày: "/>
                                <h:outputText value=""/>
                                <h:outputText value=""/>

                                <p:selectOneMenu value="#{treeProduct.ctId}" style="width: 150px">
                                    <f:selectItems value="#{treeProduct.listCTNotIn}" var="ct" itemLabel="#{ct.name}" itemValue="#{ct.id}"/>
                                </p:selectOneMenu>

                                <p:calendar pattern="dd-MM-yyyy" showOn="button" value="#{treeProduct.from_date}" style="width: 150px"/>

                                <p:calendar pattern="dd-MM-yyyy" showOn="button" value="#{treeProduct.to_date}" style="width: 150px"/>

                                <p:commandButton styleClass="ui-icon ui-icon-circle-check" style="width: 20px;height: 20px" action="#{treeProduct.insertPContent()}" update=":formDlgQLContent" onclick="statusDialog2.show();" oncomplete="statusDialog2.hide();"/>
                                <p:commandButton styleClass="ui-icon ui-icon-circle-close" style="width: 20px;height: 20px" action="#{treeProduct.closeAdd()}" update=":formDlgQLContent"/>
                            </h:panelGrid>
                        </h:form>
                    </p:dialog>
                    <!--sua product content-->
                    <p:dialog widgetVar="dlgEditPContent" header="Sửa Product's content" modal="true">
                        <h:form id="formEditPContent">
                            <p:growl/>
                            <p:dialog modal="true" widgetVar="statusDialog" header="Đang xử lí.."   
                                      draggable="false" closable="false">  
                                <p:graphicImage value="../../images/ajax-loader.gif" />  
                            </p:dialog>
                            <h:panelGrid columns="2">
                                <h:outputText value="Template: "/>
                                <p:selectOneMenu value="#{treeProduct.ctName}" style="width: 165px">
                                    <f:selectItems value="#{treeProduct.listCT}" var="ct" itemLabel="#{ct.name}" itemValue="#{ct.name}"/>
                                </p:selectOneMenu>
                                <h:outputText value="Từ ngày: "/>
                                <p:calendar pattern="dd-MM-yyyy" showOn="button" value="#{treeProduct.from_date}"/>
                                <h:outputText value="Đến ngày: "/>
                                <p:calendar pattern="dd-MM-yyyy" showOn="button" value="#{treeProduct.to_date}"/>
                            </h:panelGrid>
                            <p:commandButton value="Lưu" action="#{treeProduct.updatePContent()}" update=":formDlgQLContent" oncomplete="dlgEditPContent.hide();statusDialog.hide()" onclick="statusDialog.show();"/>
                        </h:form>
                    </p:dialog>
                    <!--dialog xoa product content-->
                    <p:dialog widgetVar="dlgDelPContent" header="Xóa Product's content" modal="true">
                        <h:form id="formDlgDelContent">
                            <h:outputText value="Bạn có chắc chắn muốn xóa bản ghi này?"/>
                            <p:commandButton value="Xác nhận" action="#{treeProduct.removePContent()}" oncomplete="dlgDelPContent.hide()" update=":formDlgQLContent"/>
                        </h:form>
                    </p:dialog>
                </p:layoutUnit>
                <p:layoutUnit id="bottom" position="bottom" size="60">
                    <ui:insert name="footer">
                        <ui:include src="../../templates/footer.xhtml"/>
                    </ui:insert>
                </p:layoutUnit>
            </div>
        </div>
    </h:body>
</html>

